{% extends "../layouts/base.twig" %}

{% block title %}登录{% endblock %}

{% block styles %}
    <link href="/static/hplus/css/plugins/iCheck/custom.css" rel="stylesheet">
    <script>if (window.top !== window.self) {
            window.top.location = window.location;
        }</script>
{% endblock %}

{% block body %}
    <div class="container-fluid">
        {% if err.Error() != nil %}
            <div class="alert alert-danger" role="alert">
                {{ err.Error() }}
            </div>
        {% endif %}
        <div class="row">
            <div class="col-lg-10">
                <div class="row">
                    <div class="col-xs-12 col-sm-4 col-md-4 col-lg-5 col-md-offset-1">
                        <div class="tile">
                            <h3>welcome</h3>
                            <form role="form" action="" class="form-horizontal" method="post">
                                <div class="form-group">
                                    <label for="exampleInputEmail1" class="col-sm-1 col-xs-1 control-label"><i
                                                class="fa fa-user fa-lg"></i></label>
                                    <div class="col-sm-11 col-xs-11">
                                        <input type="text" class="form-control" placeholder="用户名" required=""
                                               name="username" value="{{ form.Username }}"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1" class="col-sm-1 col-xs-1 control-label"><i
                                                class="fa fa-lock fa-lg"></i></label>
                                    <div class="col-sm-11 col-xs-11">
                                        <input type="password" class="form-control" placeholder="密码" required=""
                                               name="password"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-8 col-xs-8 col-sm-offset-1 col-xs-offset-1">
                                        <input type="text" class="form-control" placeholder="请输入验证码" name="verifyCode"
                                               value="{{ form.VerifyCode }}"
                                               required=""/>
                                    </div>
                                    <label for="exampleInputEmail1" class="col-sm-3 col-xs-3 control-label"> <img
                                                src="/captcha" class="img-responsive"
                                                onclick="javascript:this.src='/captcha?time='+Math.random()"/></label>
                                </div>
                                <p class="text-muted text-center"><a href="#">
                                        <small>忘记密码了？</small>
                                    </a> | <a href="/register">注册一个新账号</a>
                                </p>
                                <button type="submit" class="btn btn-primary btn-large btn-block">登录</button>
                            </form>
                        </div>
                    </div>
                </div> <!-- /row -->
            </div>
        </div> <!-- /row -->
    </div>
{% endblock %}

{% block scripts %}
    <script>
        function change() {
            $.get('/captcha', {refresh: 1}, function (data) {
                evaldata = eval(data);
                $("#code_img").attr('src', evaldata.url);
            });
        }
    </script>
{% endblock %}



